package com.zhou.common.base.mq.model;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @author li.ke
 * @date 2020/12/28
 */
@ApiModel("分页参数")
@Data
public class PageParam {
    @ApiModelProperty(value = "页数", example = "1")
    @NotNull(message = "页数不能为空")
    private Integer pageNo = 1;
    @ApiModelProperty(value = "每页大小", example = "10")
    @NotNull(message = "每页大小不能为空")
    private Integer pageSize = 10;

    public IPage toPage() {
        return new Page(this.pageNo,this.pageSize);
    }
}